package com.friends.digitpic.service.service.impl;

import javax.annotation.Resource;

import org.jeecgframework.minidao.pojo.MiniDaoPage;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.stereotype.Component;
import com.friends.digitpic.service.dao.UserDao;
import com.friends.digitpic.service.entity.UserEntity;
import com.friends.digitpic.service.service.UserService;

/**
 * 描述：用户
 * @author: jiangge xia
 * @since：2018年09月15日 22时44分21秒 星期六 
 * @version:1.0
 */

@Transactional
@Component
public class UserServiceImpl implements UserService {

	@Resource(name = "userDao")
	private UserDao userDao;


	public UserEntity getUser(String userid) {
		return userDao.get(userid);
	}

	public int updateUser(UserEntity user) {
		return userDao.update(user);
	}

	public void insertUser(UserEntity user) {
		userDao.insert(user);
		
	}

	public MiniDaoPage<UserEntity> getUserAll(UserEntity user, int page, int rows) {
		return userDao.getAll(user, page, rows);
	}

	public void deleteUser(UserEntity user) {
		userDao.delete(user);
		
	}
}
